﻿@if ( ShowHeader )
{
    <Paragraph TextSize="TextSize.Heading1" TextAlignment="TextAlignment.Center" Margin="Margin.Is5.FromTop.Is4.FromBottom">
        Blazorise licensing FAQ
    </Paragraph>
}

<Accordion>
    @for ( var i = 0; i < faqInfos.Count; i++ )
    {
        var faqInfo = faqInfos[i];
        var index = i + 1;

        <Collapse @key="@faqInfo" Visible="@faqInfo.Visible">
            <CollapseHeader Padding="Padding.Is1.OnY">
                <Heading Size="HeadingSize.Is5" TextAlignment="TextAlignment.Start" Margin="Margin.Is0.OnY">
                    <AccordionToggle Clicked="@(() => faqInfo.Visible = !faqInfo.Visible)">
                        @($"{index}. {faqInfo.Title}")
                    </AccordionToggle>
                </Heading>
            </CollapseHeader>
            <CollapseBody TextAlignment="TextAlignment.Start">
                @faqInfo.Body
            </CollapseBody>
        </Collapse>
    }
</Accordion>
@code {
    [Parameter] public bool ShowHeader { get; set; } = true;

    class FaqInfo
    {
        public bool Visible { get; set; }

        public string Title { get; set; }

        public RenderFragment Body { get; set; }
    }

    private List<FaqInfo> faqInfos = new List<FaqInfo>
    {
        new FaqInfo {
            Title = "How does Blazorise license software?",
            Body = (__builder) => {
                <Paragraph>
                    We license on a per-developer basis. All members of a development team using our products will need a license. We do not charge run-time, royalty, or deployment fees. For additional details on our licensing, please refer to our pricing and plan details.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "Is subscription renewal automatic?",
            Body = (__builder) => {
                <Paragraph>
                    Renewal is automatic if the license was purchased through our website and paid by credit card. It will recur after the subscription period ends. You can cancel your subscription at any time.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "What happens if I stop with yearly subscription?",
            Body = (__builder) => {
                <Paragraph>
                    If you end your yearly subscription, you will no longer receive Blazorise updates, access to our support site, or access to private repositories. You may continue to use the last version available at the time your subscription ended.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "Is the license perpetual?",
            Body = (__builder) => {
                <Paragraph>
                    <Strong>Yes.</Strong> You can continue to use the product in production after the entitlement expires. To keep developing, receive new features, or access technical support, an active subscription is required.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "Am I allowed to use the product after the update entitlement expires?",
            Body = (__builder) => {
                <Paragraph>
                    <Strong>Yes.</Strong> You can continue to use the product in production environments after the entitlement expires. But you will need to keep your subscription active to continue development, update for new features, or gain access to technical support.
                </Paragraph>
                <Paragraph>
                    To renew your license, please <Anchor To="mailto:sales@blazorise.com" Title="Contact Sales">contact sales</Anchor>.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "Does the license include support?",
            Body = (__builder) => {
                <Paragraph>
                    <Strong>Yes.</Strong> Blazorise Professional and Blazorise Enterprise include dedicated support via our <Anchor To="https://blazorise.com/support" Title="Support forum">support forum</Anchor> during the subscription period.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "How many licenses do I need?",
            Body = (__builder) => {
                <Paragraph>
                    The number of licenses purchased must correspond to the maximum number of concurrent developers contributing changes to the front-end code of projects that use Blazorise.
                </Paragraph>
                <Paragraph>
                    <Strong>Example 1.</Strong> Company A is developing an application named 'AppA'. The app needs to render 10k rows of data in a table and allow users to group, filter, and sort. The dev team adds Blazorise to the project to satisfy this requirement. 5 front-end and 10 back-end developers are working on 'AppA'. Only 1 developer is tasked with configuring and modifying the data grid. Only the front-end developers are contributing code to the front-end so Company 'A' purchases 5 licenses.
                </Paragraph>
                <Paragraph>
                    <Strong>Example 2.</Strong> A UI team at Company A creates an internal UI library that includes Blazorise as a component. Teams working on 'AppA' (5 front-end devs) and 'AppB' (3 front-end devs) use it. There are 2 front-end devs on the UI team. Company B purchases 10 licenses.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "Do I need to purchase license if I'm freelancer and work with Blazorise for my clients?",
            Body = (__builder) => {
                <Paragraph>
                    If freelancers use Blazorise for client projects, they are considered developers using Blazorise in their work and need a commercial license. Who purchases the license depends on the agreement between the freelancer and the client.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "If I deploy Blazorise based apps to my client, do they also need to purchase license?",
            Body = (__builder) => {
                <Paragraph>
                    <Strong>No.</Strong> Your client doesn't need to purchase a Blazorise license.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "What is a customized agreement?",
            Body = (__builder) => {
                <Paragraph>
                    You can tailor the agreement to suit your company and project requirements.
                </Paragraph>
                <Paragraph>
                    To learn more, please <Anchor To="mailto:sales@blazorise.com" Title="Contact Sales">contact sales</Anchor>.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "What does the Blazorise Mentor service include?",
            Body = (__builder) => {
                <Paragraph>
                    Blazorise Mentor pairs you with a senior Blazorise expert who can answer complex questions, review decisions, and guide your team via your preferred channel, helping you avoid pitfalls and improve velocity and quality.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "What is the currency your prices are shown in?",
            Body = (__builder) => {
                <Paragraph>
                    Our prices are shown in EUR. Charges are made in your local currency when available; otherwise, they are charged in EUR.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "Do you offer volume discounts?",
            Body = (__builder) => {
                <Paragraph>
                    <Strong>Yes.</Strong> Get in touch with our <Anchor To="mailto:sales@blazorise.com" Title="Contact Sales">sales team</Anchor>.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "What is the difference between Blazorise and Blazorise Blocks?",
            Body = (__builder) => {
                <Paragraph>
                    Blazorise Blocks are ready-made sections (e.g., checkout, stats, login forms) built on top of Blazorise components, so you can integrate them without designing or coding from scratch.
                </Paragraph>
                <Paragraph>
                    In essence, while Blazorise provides the foundational components and tools, Blazorise Blocks offer higher-level, more specialized modules that are based on those foundational components for specific use cases.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "What is indemnification?",
            Body = (__builder) => {
                <Paragraph>
                    Enterprise customers receive additional protection against possible copyright or intellectual property right (IPR) claims related to any project that uses Blazorise. Indemnification options can be customized to suit an organization or project.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "What is escrow service?",
            Body = (__builder) => {
                <Paragraph>
                    Blazorise offers third-party escrow services where required for continuity. We can store the required source code with an escrow provider and release it under agreed conditions so your team can continue development if needed. Available for Enterprise subscribers.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "Can I really have unlimited tickets with the Enterprise Plus tier?",
            Body = (__builder) => {
                <Paragraph>
                    Yes, Enterprise Plus offers unlimited support tickets, subject to a fair use policy. If we detect usage indicative of misuse, we may limit tickets to ensure timely support for all enterprise customers.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "What is the process for requesting new features or enhancements?",
            Body = (__builder) => {
                <Paragraph>
                    Feature requests fall outside the scope of developer support, but we're happy to provide a quote for custom development.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "Do you have a refund policy?",
            Body = (__builder) => {
                <Paragraph>
                    You can request a refund within 30 days of purchase. Because Professional and Enterprise include source-code access, refunds for these licenses are 60% within 30 days. Renewals and subsequent license purchases are non-refundable.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "How can I obtain a copy of your latest software license agreement?",
            Body = (__builder) => {
                <Paragraph>
                    To obtain a copy of our latest software license agreement, please visit our <Anchor To="license">license page</Anchor> and download the PDF version.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "Why do you require a LinkedIn for the Community License?",
            Body = (__builder) => {
                <Paragraph>
                    To offer a Community License at no cost, we confirm eligibility using LinkedIn. We verify your profile in read-only mode; LinkedIn does not receive information about your Blazorise activity.
                </Paragraph>
            }
        },

        new FaqInfo {
            Title = "Am I eligible for a non-commercial license if my company doesn't do commercial development?",
            Body = (__builder) => {
                <Paragraph>
                    If you're employed and receiving payment, even at a non-profit, a commercial license is required.
                </Paragraph>
            }
        },
    };
}